package com.lmk.homeWork;

public class Account {

    private int id;
    private double balance;
    private double  annualInterestRate;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public double getAnnualInterestRate() {
        return annualInterestRate;
    }

    public void setAnnualInterestRate(double annualInterestRate) {
        this.annualInterestRate = annualInterestRate;
    }

    /**
     * 存款
     * @param amount
     */
     public void withdraw( double amount){
        this.balance+=amount;
        System.out.println("存入: "+amount+"\t"+"目前余额为:"+balance);

    }

    /**
     * 取款
     * @param amount
     */
    public void deposit( double amount){
        if (this.balance<amount){
            System.out.println("余额不足!");
            return;
        }
        this.balance-=amount;
        System.out.println("取出: "+amount+"\t"+"目前余额为:"+balance);
    }

    }


